-
Notifications
You must be signed in to change notification settings - Fork 63
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixup db.models.fields.Field
overloads for pyright 1.1.378
#265
Conversation
64371fe
to
15ef8d9
Compare
Hi @sbdchd, should I remove |
name: str | None = ..., | ||
primary_key: bool = ..., | ||
max_length: int | None = ..., | ||
unique: bool = ..., | ||
blank: bool = ..., | ||
null: Literal[False] = ..., | ||
null: Literal[False] = False, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still want these to be ...
, I think in general type stubs don't specify the actual default value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if i understood it correctly, then we can't do ...
more. We definitely need a default value, for the correct choice of @overload
. microsoft/pyright#8860 was closed as "as designed", so i think stubs should accept this.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed a bug that results in a false negative when overloads overlap due to default values.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we still want these to be
...
, I think in general type stubs don't specify the actual default value
@sbdchd
How strong is your commitment to ...
? Did the new rules in pyright
introduce a bit of doubt?
The dev version of pylance
already includes the new pyright
, in a month it will appear for all users.
After which nullable fields will "break" in their projects, let's fix them in advance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah seems like things have changed to allowing default values in stubs:
python/typeshed#8988 (comment)
keeping them in should be all good!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you!!
Fix for #264